<?php TPL::output('global/header.tpl.htm'); ?>

<div class="aw-container-wrap aw-work-wrap">
    <?php TPL::output('block/content_nav_menu.tpl.htm'); ?>
    <div class="container">
        <div class="row">
            <div class="aw-content-wrap clearfix">
                <!-- 侧边栏 -->
                <div class="col-sm-12 col-md-3 aw-side-bar hidden-xs hidden-sm">
                    <div class="aw-mod side-nav">
                        <h2><i class="icon icon-order"></i><?php _e('工单'); ?></h2>
                        <ul>
                            <li>
                                <a href="ticket/" class="active"><?php _e('我的工单'); ?></a>
                            </li>
                        </ul>
                    </div>
                </div>
                <!-- end 侧边栏 -->

                <div class="col-sm-12 col-md-9 aw-main-content">
                    <div class="aw-mod aw-work-list">
                        <div class="mod-head">
                            <h1>
                                <i class="icon icon-order"></i> 工单列表
                            </h1>
                        </div>
                        <div class="mod-body">
                            <table class="table table-hover aw-table">
                                <tr>
                                    <th><?php _e('状态'); ?></th>
                                    <th>ID</th>
                                    <th><?php _e('标题'); ?></th>
                                    <th><?php _e('发起时间'); ?></th>
                                    <th><?php _e('处理人'); ?></th>
                                </tr>
                                <?php if ($this->tickets_list) {
                                    foreach ($this->tickets_list AS $ticket_info) { ?>
                                <tr>
                                    <td><?php if ($ticket_info['status'] == 'closed') _e('已关闭'); else if ($ticket_info['reply_time']) _e ('已解决'); else if ($ticket_info['service_info']) _e ('已受理'); else _e('未受理'); ?></td>
                                    <td>#<?php echo $ticket_info['id']; ?></td>
                                    <td><a href="ticket/<?php echo $ticket_info['id']; ?>"><?php echo $ticket_info['title']; ?></a></td>
                                    <td><?php echo date_friendly($ticket_info['time']); ?></td>
                                    <td><?php if ($ticket_info['service_info']) { ?><a href="people/<?php echo $ticket_info['service_info']['uid']; ?>"><?php echo $ticket_info['service_info']['user_name']; ?></a><?php } else { _e('未分配'); } ?></td>
                                </tr>
                                <?php }
                                } ?>
                            </table>
                        </div>

                        <div class="mod-footer clearfix">
                            <?php if ($this->pagination) echo $this->pagination; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<?php TPL::output('global/footer.tpl.htm'); ?>
